{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Visualize violations from OPA Gatekeeper",
  "editable": false,
  "fiscalYearStartMonth": 0,
  "gnetId": 15763,
  "graphTooltip": 0,
  "iteration": 1699970633918,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "datasource": {
        "type": "prometheus",
        "uid": "$ds_prometheus"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 24,
      "panels": [],
      "title": "Summaries",
      "type": "row"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Description: Current number of constraint templates\n\"All NS\"\n\nUnderstanding this metric: Gatekeeper subscribes to a watch on all ConstraintTemplate resources. Whenever one is created or deleted on the cluster, this count gets updated.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 0,
        "y": 1
      },
      "id": 28,
      "options": {
        "colorMode": "none",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (status) (gatekeeper_constraint_templates{pod=~\"gatekeeper-controller-manager-.+\"})",
          "interval": "",
          "legendFormat": "{{status}}",
          "refId": "A"
        }
      ],
      "title": "Total constraint templates",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 19,
        "x": 5,
        "y": 1
      },
      "id": 41,
      "options": {
        "displayMode": "basic",
        "minVizHeight": 10,
        "minVizWidth": 0,
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "text": {}
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (kind) (d8_gatekeeper_exporter_constraint_violations{violating_namespace=~\"$namespace\"})",
          "format": "time_series",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "{{kind}}",
          "refId": "A"
        }
      ],
      "title": "Total Violations by kind",
      "transformations": [],
      "type": "bargauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "$ds_prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "left",
            "displayMode": "auto",
            "filterable": false,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Action"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "1": {
                        "index": 2,
                        "text": "dryrun (default action)"
                      },
                      "2": {
                        "index": 1,
                        "text": "warn (default action)"
                      },
                      "3": {
                        "index": 0,
                        "text": "deny (default action)"
                      },
                      "deny": {
                        "index": 3,
                        "text": "deny (label)"
                      },
                      "dryrun": {
                        "index": 5,
                        "text": "dryrun (label)"
                      },
                      "warn": {
                        "index": 4,
                        "text": "warn (label)"
                      }
                    },
                    "type": "value"
                  }
                ]
              },
              {
                "id": "custom.width",
                "value": 269
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Policy"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "1": {
                        "index": 2,
                        "text": "privileged (default policy)"
                      },
                      "2": {
                        "index": 1,
                        "text": "baseline (default policy)"
                      },
                      "3": {
                        "index": 0,
                        "text": "restricted (default policy)"
                      },
                      "baseline": {
                        "index": 4,
                        "text": "baseline (label)"
                      },
                      "privileged": {
                        "index": 5,
                        "text": "privileged (label)"
                      },
                      "restricted": {
                        "index": 3,
                        "text": "restricted (label)"
                      }
                    },
                    "type": "value"
                  }
                ]
              },
              {
                "id": "custom.width",
                "value": 229
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Namespace"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 192
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 10,
        "x": 0,
        "y": 5
      },
      "id": 44,
      "options": {
        "footer": {
          "enablePagination": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 0,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "$ds_prometheus"
          },
          "exemplar": false,
          "expr": "group(kube_namespace_labels{namespace!~\"(d8-.+|kube-.+)\",namespace=~\"$namespace\",label_security_deckhouse_io_pod_policy=~\"(restricted|baseline|privileged)\",label_security_deckhouse_io_pod_policy_action=~\"(deny|warn|dryrun)\"}) by (namespace, label_security_deckhouse_io_pod_policy, label_security_deckhouse_io_pod_policy_action)\nor\nlabel_replace(group(kube_namespace_labels{namespace!~\"(d8-.+|kube-system)\",namespace=~\"$namespace\",label_security_deckhouse_io_pod_policy=~\n\"(privileged|restricted|baseline)\",label_security_deckhouse_io_pod_policy_action!~\"(deny|warn|dryrun)\"}) by (namespace, label_security_deckhouse_io_pod_policy, label_security_deckhouse_io_pod_policy_action), \"label_security_deckhouse_io_pod_policy_action\", \"$default_action\", \"label_security_deckhouse_io_pod_policy_action\", \".*\")\nor\nlabel_replace(group(kube_namespace_labels{namespace!~\"(d8-.+|kube-system)\",namespace=~\"$namespace\",label_security_deckhouse_io_pod_policy!~\n\"(privileged|restricted|baseline)\",label_security_deckhouse_io_pod_policy_action=~\"(deny|warn|dryrun)\"}) by (namespace, label_security_deckhouse_io_pod_policy, label_security_deckhouse_io_pod_policy_action), \"label_security_deckhouse_io_pod_policy\", \"$default_policy\", \"label_security_deckhouse_io_pod_policy\", \".*\")\nor\nlabel_replace(label_replace(group(kube_namespace_labels{namespace!~\"(d8-.+|kube-system)\",namespace=~\"$namespace\",label_security_deckhouse_io_pod_policy!~\n\"(privileged|restricted|baseline)\",label_security_deckhouse_io_pod_policy_action!~\"(deny|warn|dryrun)\"}) by (namespace, label_security_deckhouse_io_pod_policy, label_security_deckhouse_io_pod_policy_action), \"label_security_deckhouse_io_pod_policy\", \"$default_policy\", \"label_security_deckhouse_io_pod_policy\", \".*\"), \"label_security_deckhouse_io_pod_policy_action\", \"$default_action\", \"label_security_deckhouse_io_pod_policy_action\", \".*\")",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Effective PSS Policies/Actions per Namespace",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "Value": true
            },
            "indexByName": {
              "Time": 4,
              "Value": 3,
              "label_security_deckhouse_io_pod_policy": 1,
              "label_security_deckhouse_io_pod_policy_action": 2,
              "namespace": 0
            },
            "renameByName": {
              "label_security_deckhouse_io_pod_policy": "Policy",
              "label_security_deckhouse_io_pod_policy_action": "Action",
              "namespace": "Namespace"
            }
          }
        },
        {
          "id": "sortBy",
          "options": {
            "fields": {},
            "sort": [
              {
                "field": "Namespace"
              }
            ]
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Description: The number of audit violations per constraint detected in the last audit cycle\n\nUnderstanding this metric: During each run, the audit sums up all of the violations that it finds and reports these counts per-enforcement-mode.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "warn"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "orange",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "unrecognized"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "dryrun"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "deny"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 14,
        "x": 10,
        "y": 5
      },
      "id": 25,
      "options": {
        "displayMode": "gradient",
        "minVizHeight": 10,
        "minVizWidth": 0,
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "text": {}
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (enforcement_action) (gatekeeper_violations)",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "legendFormat": "{{kind}}",
          "refId": "B"
        }
      ],
      "title": "Total Violations",
      "transformations": [],
      "type": "bargauge"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "prometheus",
        "uid": "$ds_prometheus"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 11
      },
      "id": 32,
      "panels": [],
      "title": "Constraint details",
      "type": "row"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "left",
            "displayMode": "auto",
            "filterable": false,
            "inspect": false
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "PSS": {
                  "text": "PodSecurityStandard",
                  "index": 0
                }
              }
            },
            {
              "type": "regex",
              "options": {
                "pattern": "^d8-pod-security-([a-zA-Z]+)-.*",
                "result": {
                  "text": "$1",
                  "index": 1
                }
              }
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "violating_name"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 170
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "violating_kind"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 50
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Enforcement"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 107
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 155
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Policy"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 140
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Kind"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 108
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Pod name"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 400
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Namespace"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 99
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Name"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 205
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Policy Name"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 140
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Policy Type"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 170
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "id": 34,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 10,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": false,
          "expr": "group(d8_gatekeeper_exporter_constraint_violations{violating_namespace=~\".*\"}) by (violating_kind, violating_namespace, violating_name, kind, violation_enforcement, violation_msg, source_type, name)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "OPA Violations",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "Time",
                "kind",
                "violating_kind",
                "violating_name",
                "violation_enforcement",
                "violation_msg",
                "violating_namespace",
                "source_type",
                "name"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true
            },
            "indexByName": {
              "Time": 0,
              "source_type": 1,
              "name": 2,
              "kind": 3,
              "violating_kind": 5,
              "violating_name": 6,
              "violating_namespace": 4,
              "violation_enforcement": 7,
              "violation_msg": 8
            },
            "renameByName": {
              "Time": "",
              "kind": "Policy",
              "violating_kind": "Kind",
              "violating_name": "Name",
              "violating_namespace": "Namespace",
              "violation_enforcement": "Enforcement",
              "violation_msg": "Message",
              "source_type": "Policy Type",
              "name": "Policy Name"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "fill": 2,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 11,
        "x": 0,
        "y": 20
      },
      "hiddenSeries": false,
      "id": 36,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 3,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": false
      },
      "percentage": false,
      "pluginVersion": "8.5.13",
      "pointradius": 1,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "exemplar": true,
          "expr": "count by (violating_name) (d8_gatekeeper_exporter_constraint_violations{violating_namespace=~\"$namespace\"})",
          "interval": "",
          "legendFormat": "{{violating_name}}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "OPA Violations Over Time",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:107",
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:108",
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 10,
        "x": 11,
        "y": 20
      },
      "id": 38,
      "options": {
        "displayMode": "basic",
        "minVizHeight": 10,
        "minVizWidth": 0,
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "text": {}
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (kind) (d8_gatekeeper_exporter_constraint_violations{violating_namespace=~\"$namespace\"})",
          "format": "time_series",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "{{kind}}",
          "refId": "A"
        }
      ],
      "title": "Total Violations by kind",
      "transformations": [],
      "type": "bargauge"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": []
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "warn"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "orange",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 3,
        "x": 21,
        "y": 20
      },
      "id": 40,
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom"
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(d8_gatekeeper_exporter_constraint_violations{violation_enforcement=\"warn\",violating_namespace=~\"$namespace\"})",
          "interval": "",
          "legendFormat": "warn",
          "refId": "A"
        },
        {
          "exemplar": true,
          "expr": "sum(d8_gatekeeper_exporter_constraint_violations{violation_enforcement=\"deny\",violating_namespace=~\"$namespace\"})",
          "hide": false,
          "interval": "",
          "legendFormat": "deny",
          "refId": "B"
        },
        {
          "exemplar": true,
          "expr": "sum(d8_gatekeeper_exporter_constraint_violations{violation_enforcement=\"dryrun\",violating_namespace=~\"$namespace\"})",
          "hide": false,
          "interval": "",
          "legendFormat": "dryrun",
          "refId": "C"
        },
        {
          "exemplar": true,
          "expr": "sum(d8_gatekeeper_exporter_constraint_violations{violation_enforcement=\"unrecognized\",violating_namespace=~\"$namespace\"})",
          "hide": false,
          "interval": "",
          "legendFormat": "unrecognized",
          "refId": "D"
        }
      ],
      "title": "Enforcement Actions",
      "type": "piechart"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "prometheus",
        "uid": "$ds_prometheus"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 27
      },
      "id": 10,
      "panels": [],
      "title": "Audit process",
      "type": "row"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "The number of audit violations per constraint detected in the last audit cycle",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "warn"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "orange",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "unrecognized"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "dryrun"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "deny"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 4,
        "w": 12,
        "x": 0,
        "y": 28
      },
      "id": 8,
      "options": {
        "displayMode": "gradient",
        "minVizHeight": 10,
        "minVizWidth": 0,
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "text": {}
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (enforcement_action) (gatekeeper_violations)",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "legendFormat": "{{kind}}",
          "refId": "B"
        }
      ],
      "title": "Total Violations",
      "transformations": [],
      "type": "bargauge"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Latency of audit operation",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 12,
        "y": 28
      },
      "id": 12,
      "options": {
        "colorMode": "none",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "rate(gatekeeper_audit_duration_seconds_count[10m])",
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Audit duration",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Description: Timestamp of last audit run time",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 15,
        "y": 28
      },
      "id": 27,
      "options": {
        "colorMode": "none",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "time() - gatekeeper_audit_last_run_time",
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Audit last run time",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Total number of watched GroupVersionKinds",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 18,
        "y": 28
      },
      "id": 30,
      "options": {
        "colorMode": "none",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(gatekeeper_watch_manager_watched_gvk{pod=~\"gatekeeper-controller.+\"}) / sum(gatekeeper_watch_manager_watched_gvk{pod=~\"gatekeeper-controller.+\"})",
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Total GroupVersionKinds",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Total number of GroupVersionKinds with a registered watch intent",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 21,
        "y": 28
      },
      "id": 29,
      "options": {
        "colorMode": "none",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum(gatekeeper_watch_manager_intended_watch_gvk{pod=~\"gatekeeper-controller.+\"}) / sum(gatekeeper_watch_manager_intended_watch_gvk{pod=~\"gatekeeper-controller.+\"})",
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Total GroupVersionKinds registered",
      "transformations": [],
      "type": "stat"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "prometheus",
        "uid": "$ds_prometheus"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 32
      },
      "id": 16,
      "panels": [],
      "title": "Admission webook",
      "type": "row"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Description: The number of requests that are routed to mutation webhook",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 0,
        "y": 33
      },
      "id": 26,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "hidden",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "8.2.3",
      "targets": [
        {
          "exemplar": false,
          "expr": "sum by (mutation_status, pod) (rate(gatekeeper_mutation_request_count[20m]))",
          "interval": "",
          "legendFormat": "{{mutation_status}}",
          "refId": "A"
        }
      ],
      "title": "Mutation request count",
      "type": "timeseries"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Description: The number of requests that are routed to validation webhook",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 12,
        "y": 33
      },
      "id": 22,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "hidden",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "8.2.3",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (admission_status, pod) (rate(gatekeeper_validation_request_count[20m]))",
          "interval": "",
          "legendFormat": "{{admission_status}}",
          "refId": "A"
        }
      ],
      "title": "Validation request count",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "prometheus",
        "uid": "$ds_prometheus"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 39
      },
      "id": 14,
      "panels": [],
      "title": "Controller",
      "type": "row"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Description: Current number of constraint templates\n\nUnderstanding this metric: Gatekeeper subscribes to a watch on all ConstraintTemplate resources. Whenever one is created or deleted on the cluster, this count gets updated.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 3,
        "x": 0,
        "y": 40
      },
      "id": 18,
      "options": {
        "colorMode": "none",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (status) (gatekeeper_constraint_templates{pod=~\"gatekeeper-controller-manager-.+\"})",
          "interval": "",
          "legendFormat": "{{status}}",
          "refId": "A"
        }
      ],
      "title": "Constraint templates",
      "type": "stat"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Current number of constraints\nUnderstanding this metric: Gatekeeper subscribes to a watch on all constraint resources. Whenever one is created or deleted on the cluster, this count gets updated.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "warn"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "orange",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "unrecognized"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "dryrun"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "deny"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 9,
        "x": 3,
        "y": 40
      },
      "id": 19,
      "options": {
        "displayMode": "gradient",
        "minVizHeight": 10,
        "minVizWidth": 0,
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "text": {}
      },
      "pluginVersion": "8.5.13",
      "targets": [
        {
          "exemplar": true,
          "expr": "sum by (enforcement_action) (gatekeeper_constraints)",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "legendFormat": "{{kind}}",
          "refId": "B"
        }
      ],
      "title": "Constraints",
      "transformations": [],
      "type": "bargauge"
    },
    {
      "datasource": {
        "uid": "$ds_prometheus"
      },
      "description": "Description: Constraint Template ingestion duration distribution\n\nUnderstanding this metric: When Gatekeeper is notified of a new constraint template, records the time from when it has loaded the resource from etcd to after OPA successfully returns from compiling the code. If there is a compilation error, the metric is not updated.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "fillOpacity": 80,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 1
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "s"
        },
        "overrides": [
          {
            "__systemRef": "hideSeriesFrom",
            "matcher": {
              "id": "byNames",
              "options": {
                "mode": "exclude",
                "names": [
                  "gatekeeper-controller-manager-6bcfcf84cc-r4fjj"
                ],
                "prefix": "All except:",
                "readOnly": true
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": false,
                  "tooltip": false,
                  "viz": true
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 12,
        "y": 40
      },
      "id": 20,
      "options": {
        "bucketOffset": 0,
        "legend": {
          "calcs": [],
          "displayMode": "hidden",
          "placement": "bottom"
        }
      },
      "pluginVersion": "8.2.3",
      "targets": [
        {
          "exemplar": true,
          "expr": "rate(gatekeeper_constraint_template_ingestion_count[10m])",
          "interval": "",
          "legendFormat": "{{pod}}",
          "refId": "A"
        }
      ],
      "title": "Constraint template ingestion duration",
      "transformations": [],
      "type": "histogram"
    }
  ],
  "refresh": false,
  "schemaVersion": 36,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "default",
          "value": "default"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Prometheus",
        "multi": false,
        "name": "ds_prometheus",
        "options": [],
        "query": "prometheus",
        "queryValue": "",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": ".*",
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "$ds_prometheus"
        },
        "definition": "",
        "hide": 0,
        "includeAll": true,
        "label": "Namespace",
        "multi": false,
        "name": "namespace",
        "options": [],
        "query": {
          "query": "label_values(kube_pod_info{}, namespace)",
          "refId": "Prometheus-namespace-Variable-Query"
        },
        "refresh": 2,
        "regex": "^(?!d8-.+)(?!kube-system)(\\S+)",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "2",
          "value": "2"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "$ds_prometheus"
        },
        "definition": "query_result(d8_admission_policy_engine_pss_default_action)",
        "hide": 2,
        "includeAll": false,
        "label": "",
        "multi": false,
        "name": "default_action",
        "options": [],
        "query": {
          "query": "query_result(d8_admission_policy_engine_pss_default_action)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 2,
        "regex": "/.* ([^\\ ]*) .*/",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "3",
          "value": "3"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "$ds_prometheus"
        },
        "definition": "query_result(d8_admission_policy_engine_pss_default_policy)",
        "hide": 2,
        "includeAll": false,
        "multi": false,
        "name": "default_policy",
        "options": [],
        "query": {
          "query": "query_result(d8_admission_policy_engine_pss_default_policy)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 2,
        "regex": "/.* ([^\\ ]*) .*/",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "UTC",
  "title": "Admission policy engine",
  "uid": "YBgRZG6Ms",
  "version": 3,
  "weekStart": ""
}
